
//将function函数赋值给onload对象
function $$(id) {
    return document.getElementById(id);
}
//页面加载时调用的函数
function Cookiepwd(){
    var UserName = localStorage.getItem("UserName");
    var UserPassword = localStorage.getItem("UserPassword");
    if (UserName) {
        $$("UserName").value = UserName;
    }
    if (UserPassword) {
        $$("UserPassword").value = UserPassword;
	}
}
//点击“登录”按钮后调用的函数
function btnLogin_click() {
    var UserName = $$("UserName").value
    var UserPassword = $$("UserPassword").value;
    var IphoneNumber = $$("IphoneNumber").value;
    var UserVcode = $$("UserVcode").value;
    localStorage.setItem("UserName", UserName);
    if ($$("remPwd").checked&&UserName!=""&&UserPassword!=""&&IphoneNumber!=""&&UserVcode!="") {
        localStorage.setItem("UserPassword", UserPassword);
        alert('登录成功');
    } else {
        localStorage.removeItem("UserPassword");
              alert('请填写需要的字段');
    }
}